package com.ruoyi.erp.domain;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.utils.StringUtils;
import lombok.Data;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 收款记录对象 receivable_account
 * 
 * @author sauger
 * @date 2022-03-29
 */
@Data
public class ReceivableAccount extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /**  */
    private Integer id;

    /** 收款计划 */
    private Integer planId;

    /** 项目 */

    //收款计划名称
    private String title;

    @Excel(name = "项目名称")
    private String projectName;

    @Excel(name = "结算名称")
    private String settleName;

    private Integer projectId;

    /** 收款金额 */
    @Excel(name = "收款金额")
    private BigDecimal receiveAmount;

    /** 收款人 */

    private Integer receiverId;

    /** 收款时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "收款时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date receiveTime;

    /** 审批状态 */
    @Excel(name = "审批状态", dictType = "approve_status")
    private String status;

    /** 备注 */
    @Excel(name = "备注")
    private String description;

    /** 删除标志（0代表存在 2代表删除） */
    @Excel(name = "删除标志", readConverterExp = "0=正常,1=已删除", dictType = "sys_normal_disable")
    private String deleteFlag;

    private ReceivablePlan plan;

    @Excel(name = "收款人")
    private String receiverName;

    private List<SettleReceivable> settleReceivable;

    private Integer bankId;

    @Excel(name = "收款账号")
    private String bankName;

    public String getTitle(){
        return StringUtils.isNull(this.projectName) ? this.settleName : this.projectName;
    }

}
